package cn.sinata.wanglin.net.model;

import android.text.TextUtils;

import com.google.gson.annotations.SerializedName;

import cn.sinata.util.DES;

/**
 *
 * Created by liaoxiang on 16/6/20.
 */
public class ResultData<T> {

    private T resultData;
    @SerializedName("msg")
    private String message;
    private String code;

    public T getData() {
        return resultData;
    }

    public void setResultData(T result_data) {
        this.resultData = result_data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDecodeDesString(){
        if (resultData instanceof String){
            String s = (String) resultData;
            String desData = TextUtils.isEmpty(s)?"":DES.decryptDES(s);
            return "{\"msg\":\""+message+"\",\"code\":\""+code+"\",\"resultData\":"+desData+"}";
        }
        return "";
    }
}
